package com.stormframework.world.communication;

public class MovePathAction extends MoveToAction {
	
	private int index;
	private float[] path;
	
	public void setPath(float...path) {
		index = 0;
		this.path = path;
	}
	
	public boolean act(int delta) {
		if(index >= path.length) {
			index = 0;
			return true;
		}
		
		targetX = path[index];
		targetY = path[index+1];
		
		if(super.act(delta)) {
			index += 2;
		}
		return false;
	}
}
